﻿@model Eieboom.Models.ReplyModel
@using res = Sob.Resource.Views.Shared.Shared;
@{
    string weblang = Sob.Resource.Models.Web.Web.Lang != "" ? Sob.Resource.Models.Web.Web.Lang : "zh-cn";
    Eieboom.General.GeneralConfigInfo ci = ViewBag.CI as Eieboom.General.GeneralConfigInfo;
  } 
<div id="comment"></div>
@if (Model.ReplyPermit == 1)
{
<h2>@(res.AddComment)</h2>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div id="Loading">@Sob.Resource.Views.Home.Home.Ajax_Wait</div>
<div id="AjaxResult"></div>
using (Ajax.BeginForm("AjaxReply", new AjaxOptions { LoadingElementId = "Loading", InsertionMode = InsertionMode.InsertBefore, OnSuccess = "CommentSubmitSuccess" }))
{
    <div id="commentform">
        <fieldset>
            <legend>@res.Content</legend>
             @Html.HiddenFor(m => m.ArticleId)
             @Html.HiddenFor(m => m.CateId)
            <div class="editor-label">
                @Html.LabelFor(m => m.UserName)
            </div>
            <div class="editor-field">
                @if (string.IsNullOrWhiteSpace(Model.UserName))
                {
                    @Html.TextBoxFor(m => m.UserName, new { style = "width: 200px;" })
                }
                else
                {
                   @Html.TextBoxFor(m => m.UserName, new { style = "width: 200px;border:#fff", ReadOnly = "readonly" })
                }
                @Html.ValidationMessageFor(m => m.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Url)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Url)
                @Html.ValidationMessageFor(m => m.Url)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Reply)
            </div>
            <div class="editor-field clstxtarea">
                @Html.TextAreaFor(model => model.Reply, new { style = "width: 600px; height: 150px" })
                @Html.ValidationMessageFor(m => m.Reply)
            </div>
            <p>
                <input type="submit" value="@Sob.Resource.Views.Home.Home.Submit" id="BtnSubmit"/>
            </p>
        </fieldset>
    </div>
}
}